<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>


<isperp:problemView readonly="true">
	<jsp:body>	

<jsp:include page="step1view.jsp"></jsp:include>
<%-- <jsp:include page="step2view.jsp"></jsp:include> --%>


<%-- <div class="header">
	<h3>问题响应</h3>
</div>
<table class="form-table">
	<tr>
		<td class="td1">计划完成日期：</td>
		<td class="td2"><input id="finishTimePlan" name="finishTimePlan"
			type="datetime" class="datetime required"
			value="<fmt:formatDate value="${model.finishTimePlan }"
				pattern="yyyy-MM-dd HH:mm" />" /></td>
	</tr>
	<tr>
		<td class="td1">计划所需工时：</td>
		<td class="td2"><input type="text" id="workingHourPlan"
			name="workingHourPlan" class="required number"
			value="${model.workingHourPlan }">
	</tr>
	<tr>
		<td class="td1">制订解决方案：</td>
		<td class="td2" colspan="3">${model.solutionTemp }</td>
	</tr> 
</table> --%>
<form class="validate" id="problemForm" action="problem/problem/save"
			method="post">
	<input name="id" type="hidden" value="${model.id }">


	<div class="header">
		<h3>问题处理</h3>
	</div>
	<table class="form-table">
	
	    <tr>
		<td class="td1">原因分析 ：</td>
		<td class="td2">
		<textarea id="effectAnalysis" name="effectAnalysis" class="required">${model.effectAnalysis }</textarea>
		</td>
	</tr>
	
	<tr>
			<td class="td1">实施人：</td>
			<td class="td2" colspan="3">
			   <input id="executer" style="display:none" name="executer" value="${model.executer }"> <isperp:departmentUser
							displayValue="${model.executerName }"
							idFieldName="name" valueControlId="executer"
							id="executerName" name="executerName"
							displayValueCssClass="required"></isperp:departmentUser>
			
					</td>
		</tr>
		<tr>
			<td class="td1">实施日期：</td>
			<td class="td2" colspan="3">
							<input id="req" name="executeTime" value="${model.executeTime }"
						class="required" type="datetime">
					</td>
		</tr>

		<tr>
			<td class="td1">问题处理记录：</td>
			<td class="td2" colspan="3"><textarea id="solution"
							name="solution" class="required">${model.solution }</textarea>
					</td>
		</tr>
		
		<tr>
			<td class="td1">处理工时：</td>
			<td class="td2" colspan="3"><input type="text"
						id="workingHourActual" value="${model.workingHourActual }"
						name="workingHourActual" class="number required" />
					</td>
		</tr>


		<%-- <tr>
			<td class="td1">配置入库情况：</td>
			<td class="td2" colspan="3"><isperp:dictSelector name="ciIn"
					selectedValue="${model.ciIn }" hasEmptyValue="true"
					dictCssClass="required" id="ciIn" typeCode="PROBLEM_CI_IN"></isperp:dictSelector>
			</td>
		</tr> --%>
		
		
		 
	</table>
	<div class="header">
		<h3>关联流程</h3>
	</div>
	<isperp:processRelation businessKey="${detail.id }" readonly="false"
		processKey="problemProcess" projectIdControl="projectId"></isperp:processRelation>
			<br><br><br><br>
</form>

</jsp:body>
</isperp:problemView>

<isperp:buttonList>
	<isperp:processButtons processKey="problemProcess" formId="problemForm"
	 beforeSubmit="function(){return checkTask();}"
		processId="${model.processId }" businessKey="${model.id }"></isperp:processButtons>
</isperp:buttonList>

<script type="text/javascript">

var rs;

function checkTask(){
	var url = "problem/problem/checkKnowledge?id=${model.id}";
	$.ajax({
		url:url,
		async:false,
		success:function(result){
			rs = result;
		}
	});
	
	if(rs){
		return true;
	}else{
		isperp.alert("请关联一条知识。");
		return false;
	}
	
	return rs;
}
</script>
